package com.zyong.design.pattern.strategy.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: ReceiptStrategyContext
 * @author: zyong
 * @create: 2024-04-14 01:01
 */
public class ReceiptStrategyContext {
    private ReceiptHandleStrategy receiptHandleStrategy;

    public ReceiptStrategyContext(ReceiptHandleStrategy receiptHandleStrategy) {
        this.receiptHandleStrategy = receiptHandleStrategy;
    }

    public void setReceiptHandleStrategy(ReceiptHandleStrategy receiptHandleStrategy) {
        this.receiptHandleStrategy = receiptHandleStrategy;
    }

    /**
     * 处理回执
     * @param receipt
     */
    public void handleReceipt(Receipt receipt) {
        receiptHandleStrategy.handleReceipt(receipt);
    }
}
